package com.yyh.fanshe;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        //1.直接通过Class调用静态方法forName
        Class clas1 = Class.forName("com.yyh.fanshe.Student");
        System.out.println("clas1 = " + clas1);
        //2.通过对象调用getClass方法
        Student s = new Student();
        Class clas2 = s.getClass();
        System.out.println("clas2 = " + clas2);
        //3.通过类名.class获取Class对象
        Class clas3 = Student.class;
        System.out.println("clas3 = " + clas3);
    }
}
